<?
	require_once("inc_security.php"); 
 	
	//khoi tao object Datagird
  
	$list = new fsDataGird($id_field, $name_field, translate_text("Listing"));
	$list->add('pro_title','Tên dự án','string',1,1);
	$list->add("",translate_text("Duyệt bài"),"Active");
	//$list->add("",translate_text("Delete"),"delete");
	$list->ajaxedit($fs_table);

	$total			= new db_count("SELECT 	count(*) AS count 
											 FROM 	".$fs_table." 
											 WHERE 	1 " . $list->sqlSearch());

	$db_listing 	= new db_query("SELECT * 
									 FROM ".$fs_table." 
									 WHERE 1 " . $list->sqlSearch() . " AND pro_submitable = 1
									 ORDER BY pro_title ASC," . $list->sqlSort() . $id_field ." DESC
									 " . $list->limit($total->total));
	$total_row		= mysql_num_rows($db_listing->result);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<?=$load_header?>
<?=$list->headerScript()?>
<script language="javascript" src="../../resource/js/swfObject.js"></script>
</head>
<body topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0">
<? /*---------Body------------*/ ?>
<div id="listing">
<?=$list->showHeader($total_row)?>
    <?
    $i = 0;
    while($row = mysql_fetch_assoc($db_listing->result)){
        $i++;
        ?>
        <?=$list->start_tr($i, $row[$id_field])?>
        <td><?=$row['pro_title']?></td>
        <td align="center">
        	<a onClick="loadactive(this); return false;" href="active.php?record_id=<?=$row[$id_field]?>&type=pro_active&value=<?=abs($row["pro_active"]-1)?>&url=<?=base64_encode(getURL())?>">
        		<img border="0" src="<?=$fs_imagepath?>check_<?=$row["pro_active"];?>.gif" title="Active!"/>
        	</a>
        </td>	
		<!--<?=$list->showDelete($row[$id_field]); ?>-->
  		<?=$list->end_tr();?>
        <?
    }
    ?>
    <?=$list->showFooter($total_row); ?>
</div>
<? /*---------Body------------*/ ?>
</body>
</html>
